package plugins

import (
	"context"
	"data-transfer/domain"
)

// SourceStore 大智慧数据源
type SourceStore interface {
	//GetAllTestData 取得所有测试数据
	GetAllTestData() ([]*domain.TEST_TARGET, error)

	//GetAllQNewsAnimPM 取得所有快讯证券新闻
	GetAllQNewsAnimPM(ctx context.Context) ([]*domain.T_QNEWS_ANIMPM, error)
	//GetAllQNewsAnimPM4Fix 获取时间间隔范围内的证券快讯新闻信息
	GetAllQNewsAnimPM4Fix(ctx context.Context, startDate string, endDate string) ([]string, error)
	//GetAllNews 取得所有快讯信息
	GetAllNews(ctx context.Context, news []*domain.T_QNEWS_ANIMPM) ([]*domain.NEWS, error)
	//FixNews 补充快讯数据
	FixNews(ctx context.Context, sourceKeys []string, t TargetStore) error
	//GetAllTqSkBasicInfo 取得所有股票基本信息
	GetAllTqSkBasicInfo(ctx context.Context) ([]*domain.TQ_SK_BASICINFO, error)
	//GetTqFinPrgFinMainIndexByCompCode 财务数据-主要指标：根据 compCode 取得 主要财务指标(产品表）数据
	GetTqFinPrgFinMainIndexByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_FIN_PRGFINMAININDEX, error)
	//GetTqFinProQinDicByCompCode 财务数据-主要指标-单季度
	GetTqFinProQinDicByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_FIN_PROQINDIC, error)
	//GetTqFinPrgIndicDataByCompCode 财务数据-主要指标：根据 compCode 取得 衍生财务指标(产品表)信息
	GetTqFinPrgIndicDataByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_FIN_PRGINDICDATA, error)
	//GetTqFinPrgIndicDataSubByCompCode 财务数据-主要指标：根据 compCode 取得 衍生财务指标副表(产品表) 数据
	GetTqFinPrgIndicDataSubByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_FIN_PRGINDICDATASUB, error)
	//GetTqFinPrgBalSheetNewByCompCode 取得财务数据-资产负债:根据 compCode 取得 一般企业资产负债表(新准则产品表)数据
	GetTqFinPrgBalSheetNewByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_FIN_PRGBALSHEETNEW, error)
	//GetTqFinPrgIncStatementNewByCompCode 取得财务数据： 根据 compCode 取得  一般企业利润表(新准则产品表)
	GetTqFinPrgIncStatementNewByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_FIN_PRGINCSTATEMENTNEW, error)
	//GetTqFinPrgPasqSubjectsByCompCode 取得财务数据： 根据 compCode 取得  单季衍生利润科目(产品表）
	GetTqFinPrgPasqSubjectsByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_FIN_PRGPASQSUBJECTS, error)

	//GetTqFinPrgCfStatementNewByCompCode 取得财务数据：根据 compCode 取得 一般企业现金流量表(新准则产品表)
	GetTqFinPrgCfStatementNewByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_FIN_PRGCFSTATEMENTNEW, error)

	//GetTqFinPrgCfsqSubjectsByCompCode 取得财务数据：根据 compCode 取得 一般企业现金流-单季度量表(新准则产品表)
	GetTqFinPrgCfsqSubjectsByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_FIN_PRGCFSQSUBJECTS, error)

	//GetAllSkDailyPrice 获取证券涨跌数据信息
	GetAllSkDailyPrice(ctx context.Context, news []*domain.T_QNEWS_ANIMPM) ([]*domain.SK_INFO_CHANGE, error)

	//GetAllSkDailyPriceAndInsert 查询证券涨跌数据并分批次插入
	GetAllSkDailyPriceAndInsert(ctx context.Context, infos []*domain.TQ_SK_BASICINFO, t TargetStore) (int64, error)

	//GetSkDailyPricesByTrCode 根据trCode 获取涨跌、涨跌值等股票历史交易信息
	GetSkDailyPricesByTrCode(ctx context.Context, trCode string) ([]*domain.TQ_QT_SKDAILYPRICE, error)
	//GetSkDailyPrices 获取涨跌、涨跌值等股票历史交易信息
	GetSkDailyPrices(ctx context.Context) ([]*domain.TQ_QT_SKDAILYPRICE, error)

	//GetQNewsBasicBySourceKey 根据sourceKey取得所有快讯新闻基本信息
	GetQNewsBasicBySourceKey(ctx context.Context, sourceKey string) ([]*domain.T_QNEWS_BASIC, error)
	//GetAllKeyIndicatorInfo 根据股票信息，取得所有财务指标数据
	GetAllKeyIndicatorInfo(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.KEY_INDICATOR, error)
	//GetAllKeyIndicatorInfoSq 根据股票信息，取得所有财务指标数据(单季度)
	GetAllKeyIndicatorInfoSq(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.KEY_INDICATOR_SQ, error)
	//GetAllTqFinPrgBalSheetNew 根据股票信息 获取所有资产负债信息
	GetAllTqFinPrgBalSheetNew(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.BALANCE_SHEET, error)
	//GetAllIncomeStatement 根据股票信息，获取所有企业利润信息
	GetAllIncomeStatement(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.INCOME_STATEMENT, error)
	//GetAllIncomeStatementSq 根据股票信息，获取所有企业单季度利润信息
	GetAllIncomeStatementSq(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.INCOME_STATEMENT_SQ, error)

	//GetAllCashFlow 根据股票信息，获取所有企业的现金流
	GetAllCashFlow(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.CASH_FLOW, error)
	//GetAllCashFlowSq 根据股票信息，获取所有企业的单季度现金流
	GetAllCashFlowSq(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.CASH_FLOW_SQ, error)

	//GetAllAnnouncement4Fix 获取时间间隔范围内的公告信息
	GetAllAnnouncement4Fix(ctx context.Context, startDate string, endDate string) ([]*domain.ANNOUNCEMENT, error)
	//GetAllAnnouncement 根据股票信息 获取所有公告信息
	GetAllAnnouncement(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.ANNOUNCEMENT, error)
	//GetTqSkImportEventBySymbolAndCompCode 根据symbol和compCode取得大事提醒
	GetTqSkImportEventBySymbolAndCompCode(ctx context.Context, symbol string, compCode string) ([]*domain.TQ_SK_IMPORTEVENT, error)

	//GetAllEventRemind 根据股票信息 获取所有公告信息
	GetAllEventRemind(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.EVENT_REMIND, error)
	//GetTqSkAnnouncemtByCompCode 根据compCode 取得公告信息
	GetTqSkAnnouncemtByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_SK_ANNOUNCEMT, error)

	//GetTqQaAnntFileByAnnouncemtId 根据公告ID获取PDF文件的路径相对目录
	GetTqQaAnntFileByAnnouncemtId(ctx context.Context, announcemtId int) (*domain.TQ_OA_ANNTFILE_DLFC, error)

	//GetAllDividend 取得分红配送
	GetAllDividend(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.DIVIDEND, error)
	// GetTqSkBonusByCompCode 根据compCode取得股票分红
	GetTqSkBonusByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_SK_BONUS, error)

	// GetAllMargin 取得所有融资融券
	GetAllMargin(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.MARGIN, error)
	// GetTqSkFinMrgnInfoBySymbol 根据Symbol获取融资融券交易明细
	GetTqSkFinMrgnInfoBySymbol(ctx context.Context, symbol string) ([]*domain.TQ_SK_FINMRGNINFO, error)

	// GetAllProfitForecast 取得所有业绩盈利预测
	GetAllProfitForecast(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.PROFIT_FORECAST, error)
	// GetTqSkExptPerformanceByCompCode 根据CompCode取得上市公司业绩预测
	GetTqSkExptPerformanceByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_SK_EXPTPERFORMANCE, error)

	// GetAllProfitForecastNew 取得所有业绩盈利预测, 从TQ_EXPT_SKSTATN表取值
	GetAllProfitForecastNew(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.PROFIT_FORECAST, error)
	// GetTqExptSkstatnBySymbol 根据symbol获取最新发布日期的个股一致预期信息
	GetTqExptSkstatnBySymbol(ctx context.Context, symbol string) ([]*domain.TQ_EXPT_SKSTATN, error)

	// GetStdRatingCounts 返回相应证券的标准评级的评级机构个数
	GetStdRatingCounts(ctx context.Context, symbol string, stdRating string, ratingValid string) (int, error)
	//GetAllRatingCount 取得所有证券的评级机构统计个数
	GetAllRatingCount(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.RATING_COUNT, error)

	//GetTqExptSkinvRatingBySymbol 投资评级 根据symbol取得证券所有评级信息
	GetTqExptSkinvRatingBySymbol(ctx context.Context, symbol string) ([]*domain.TQ_EXPT_SKINVRATING, error)
	//GetAllRating 取得所有机构评级信息
	GetAllRating(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.RATING, error)

	//GetTqSkShareStruChgByCompCode 根据compCode获取股本结构变化
	GetTqSkShareStruChgByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_SK_SHARESTRUCHG, error)
	//GetAllEquityStructure 获取所有股本结构信息
	GetAllEquityStructure(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.EQUITY_STRUCTURE, error)

	//GetAllEquityStruChg 获取所有股本变动信息
	GetAllEquityStruChg(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.EQUITY_STRUCTURE_CHANGE, error)

	//GetAllTenCirculatingSharesHolder 获取所有十大流通股股东
	GetAllTenCirculatingSharesHolder(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.TEN_CIRCULATING_SHARES_HOLDER, error)
	//GetTqSkOtsHolderByCompCode 根据compCode获取流通股东名单
	GetTqSkOtsHolderByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_SK_OTSHOLDER, error)

	//GetAllBonusFinancing 取得所有分红融资
	GetAllBonusFinancing(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.BONUS_FINANCING, error)

	//GetTqQtBizUnitTrdInfoBySymbol 根据symbol获取营业部的交易公开信息
	GetTqQtBizUnitTrdInfoBySymbol(ctx context.Context, symbol string) ([]*domain.TQ_QT_BIZUNITTRDINFO, error)
	//GetAllRankList 获取所有龙虎榜信息
	GetAllRankList(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.RANK_LIST, error)

	//GetTqQtBlockTradeBySymbol 根据symbol获取大宗交易
	GetTqQtBlockTradeBySymbol(ctx context.Context, symbol string) ([]*domain.TQ_QT_BLOCKTRADE, error)
	//GetAllBlockTrading 取得所有大宗交易
	GetAllBlockTrading(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.BLOCK_TRADING, error)

	//GetTqCompPersonRecordByPersonalCode 根据personalCode获取个人档案信息
	GetTqCompPersonRecordByPersonalCode(ctx context.Context, personalCode string) (*domain.TQ_COMP_PERSONRECORD, error)
	//GetTqCompManagerByCompCode 根据CompCode 获取公司高管信息
	GetTqCompManagerByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_COMP_MANAGER, error)
	//GetALlCompanyExecutives 取得所有公司高管信息
	GetALlCompanyExecutives(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.COMPANY_EXECUTIVES, error)

	//GetTqSkBusiInfoByCompCode 根据compCode 获取公司经营情况数据
	GetTqSkBusiInfoByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_SK_BUSIINFO, error)
	//GetAllMainComposition 取得公司所有主要业务信息
	GetAllMainComposition(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.MAIN_COMPOSITION, error)

	//GetTqCompInfoByCompCode 根据compCode获取机构资料信息
	GetTqCompInfoByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_COMP_INFO, error)
	//GetAllCompanyProfile 取得公司所有基本情况
	GetAllCompanyProfile(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.COMPANY_PROFILE, error)

	//GetSkDailyPricesBySeCodeAndTradeDate 根据Secode和tradeDate获取股票历史日交易信息
	GetSkDailyPricesBySeCodeAndTradeDate(ctx context.Context, seCode string, tradeDate string) ([]*domain.TQ_QT_SKDAILYPRICE, error)
	//GetTqSkShareHolderNumByCompCode 根据compCode获取股东户数统计信息
	GetTqSkShareHolderNumByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_SK_SHAREHOLDERNUM, error)
	//GetAllHolderChange 取得素有股东变动数据
	GetAllHolderChange(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.HOLDER_CHANGE, error)

	//GetTqSkShareStruChgByCompCodeAndPublishDate 根据compCode和publishDate 获取股本结构变化
	GetTqSkShareStruChgByCompCodeAndPublishDate(ctx context.Context, compCode string, publishDate string) (*domain.TQ_SK_SHARESTRUCHG, error)
	//GetTqSKShareHolderByCompCode 根据compCode 获取股东名单
	GetTqSKShareHolderByCompCode(ctx context.Context, compCode string) ([]*domain.TQ_SK_SHAREHOLDER, error)
	//GetAllTenHolder 获取十大股东信息
	GetAllTenHolder(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.TEN_HOLDER, error)

	//GetTqSkFundamentalsBySymbol 根据 symbol获取股票基本面简表
	GetTqSkFundamentalsBySymbol(ctx context.Context, symbol string) ([]*domain.TQ_SK_FUNDAMENTALS, error)
	//GetAllLatestIndicator 获取最新指标
	GetAllLatestIndicator(ctx context.Context, basicInfos []*domain.TQ_SK_BASICINFO) ([]*domain.LATEST_INDICATOR, error)

	// GetTqFinPrgbincstatementnewByBizKey 取得银行利润信息
	GetTqFinPrgbincstatementnewByBizKey(ctx context.Context, compCode string, endDate string, reportYear string, reportDateType string) (*domain.TQ_FIN_PRGBINCSTATEMENTNEW, error)

	//GetAppendedBizData 取得指定时间间隔的业务数据
	GetAppendedBizData(ctx context.Context, tableName string, startDate string, endDate string) (interface{}, error)
}
